/*
 *  Created by Wu Heshun on 09-3-10.
 *  Copyright 2009 handcn. All rights reserved.
 *
 */
#ifndef _totem_obj_config_h_
#define _totem_obj_config_h_

#include "graphic_public.h"
#include <string>
#include <deque>

typedef struct object_base_info_tag{
	float_t density;
	float_t friction;
	float_t elasticity;
	cpVect force;
	//template<typename A>
	//friend void serialize(A&, object_base_info_tag&, unsigned int const);
}object_base_info_t;

typedef struct totem_obj_info_tag{
	static const int VERT_NUM = 4;
	cpVect pos;
	
	float_t density;
	
	//Chipmunk uses the Coulomb friction model, a value of 0.0 is frictionless
	float_t friction; 
	//Elasticity of the shape. A value of 0.0 gives no bounce, while a value of 1.0 will give a "perfect" bounce.
	float_t elasticity;
	
	//const char *texture_name;
	std::string texture_name;
	
	bool is_polygon;
	bool is_explosive;
	bool is_TNT;
	cpVect force;
	cpVect verts[VERT_NUM];

	inline totem_obj_info_tag& operator=(const object_base_info_t& rhs) {
		density = rhs.density;
		elasticity = rhs.elasticity;
		friction = rhs.friction;
		force = rhs.force;
		return *this;
	}
}totem_obj_info_t;

typedef totem_obj_info_t object_t;
typedef std::deque<object_t> object_con_t;

typedef struct {
	int passSteps;
	int level;
	std::string bgImg;
	object_con_t objs;
}map_info_t;

namespace maps{
	typedef object_con_t::const_iterator map_iterator_t;
	void getMaps(int index, map_iterator_t &iter, map_iterator_t &end);
	map_info_t &getMapinfo(int index);
};
const char * const STR_IRON = "铁箱子";
const char * const STR_MAIN_ICON = "主体人物";
const char * const STR_PLASTICS = "弹力箱子";
const char * const STR_LIGHT_BOX = "氢气箱子";
const char * const STR_TNT_BOX = "火药箱子";

const cpVect SCENE_EDGES[] =
{
{0, 35},
{480, 35},
};

#endif //_totem_obj_config_h_